package com.qinggeng.common.enums;

import com.qinggeng.common.exception.CustomException;

/**
 * @author 吴鹏飞
 * @date 2020/11/23
 * 提现类型
 */
public enum WithdrawalTypeEnum {
    WX("10","微信"),ALI("20","支付宝"),WX_MINI("30","微信小程序");
    private final String value;
    private final String info;

    WithdrawalTypeEnum(String value, String info) {
        this.value = value;
        this.info = info;
    }

    public String getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }


    public static boolean isValue(String str) {
        for (WithdrawalTypeEnum withdrawalTypeEnum : WithdrawalTypeEnum.values()) {
            if (withdrawalTypeEnum.value.equals(str)){
                return  true;
            }
        }
        throw  new CustomException("支付方式选择错误");
    }
}
